package ru.evga.gwt.lib.common.client.request.params;

import com.google.gwt.core.client.JavaScriptObject;

public class FindEntityRangeParams
    extends BaseServiceParams
{
    protected FindEntityRangeParams()
    {
    }

    static public final FindEntityRangeParams createDefaultParams() 
    {
        FindEntityRangeParams params = createEmptyParams();
        params.setAsc(false);
        params.setFirstResult(0);
        params.setMaxResults(10);
        params.setOrderBy("id");
        return params;
        
    };

    static public final native FindEntityRangeParams createEmptyParams() /*-{
		return eval("({})");
    }-*/;

    // JSNI methods 
    public final native void setEntityName(String entityName) /*-{
		this.entityName = entityName;
    }-*/;

    public final native String getEntityName() /*-{
		return this.entityName;
    }-*/;

    public final native void setFirstResult(int firstResult) /*-{
		this.firstResult = firstResult;
    }-*/;

    public final native int getFirstResult() /*-{
		return this.firstResult;
    }-*/;

    public final native void setMaxResults(int maxResults) /*-{
		this.maxResults = maxResults;
    }-*/;

    public final native String getOrderBy() /*-{
		return this.orderBy;
    }-*/;

    public final native void setOrderBy(String orderBy) /*-{
		this.orderBy = orderBy;
    }-*/;

    public final native boolean isAsc() /*-{
		return this.isAsc;
    }-*/;

    public final native void setAsc(boolean isAsc) /*-{
		this.isAsc = isAsc;
    }-*/;
    
    public final native void setFilter(JavaScriptObject filter)/*-{
        this.filter = filter;
    }-*/;
    
    public final native JavaScriptObject getFilter()/*-{
        return this.filter;
    }-*/;
}
